package org.jiajie.coffeecodes.concurrent.poison;

/**
 * @author jay
 */
public class Step {
    private String stepName;

    public Step(String stepName) {
        this.stepName = stepName;
    }

    public void execute(){
        System.out.println(stepName + " 开始执行");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(stepName + " 结束执行");
    }

    public void purge(){
        System.out.println("任务中断，清理" + stepName + "步骤");
    }
}
